/** \file Ex.cc
 * Definitions for the various exception classes.
 *
 * (C) Copyright 2003-2006 by Semih Cemiloglu
 * All rights reserved, see COPYRIGHT file for details.
 *
 * $Id: Ex.cc 117 2006-06-19 06:49:41Z semihc $
 *
 *
 */

#include "Ex.hh"
#include "ExString.hh"
#include <iostream>


using namespace std;
using namespace TC;


TC_IDENT("$Id$");


// Unknown Exception message
const char* const TC::UnknownExStr = "Unknown Exception";


void Ex::print(ostream& os) const
{
  os << "Ex[";
  if(m_desc)
    os << m_desc;
  if(m_reason)
    os << '|' << m_reason ;
  os << ']';
}


void ExSimple::print(ostream& os) const
{
  this->Ex::print(os);
  os << " at " << m_file << ':' << m_lineno;
  if(m_func)
    os << '@' << m_func;
}


void ExString::print(ostream& os) const
{
  this->ExSimple::print(os);
  os << ' ' << m_dstr ;
}

